-- GENERATED SPELL FOR [Deatholme Necromancer] --


function spell0_16317(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(9613,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16317', 3000, 1)
end

function spell1_16317(pUnit, Event) --@Slave Drain,Heal--
pUnit:FullCastSpellOnTarget(29067,pUnit)
pUnit:RegisterEvent('Sorts_16317', 1000, 1)
end

function spell2_16317(pUnit, Event) --@Summon Dreadbone Skeleton,Self--
pUnit:FullCastSpellOnTarget(29066,pUnit)
pUnit:RegisterEvent('Sorts_16317', 626, 1)
end

function Sorts_16317(pUnit, Event)
local choix_sorts_16317 = math.random(0, 2)
if choix_sorts_16317 == 0 then
pUnit:RegisterEvent('spell0_16317', 1, 1)
end
if choix_sorts_16317 == 1 then
pUnit:RegisterEvent('spell1_16317', 1, 1)
end
if choix_sorts_16317 == 2 then
pUnit:RegisterEvent('spell2_16317', 1, 1)
end
end

function mob16317_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16317', math.random(1500, 3000), 1)
end

function mob16317_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16317_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16317_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16317, 1, 'mob16317_Action')
RegisterUnitEvent(16317, 2, 'mob16317_Leave')
RegisterUnitEvent(16317, 3, 'mob16317_Kill')
RegisterUnitEvent(16317, 4, 'mob16317_Die')
